<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>代码自动生成</title>
</head>
<body>
    <div class="item">
        <div class="item-form">
            <form action="/code/index" method="get">
                <div>
                    table_name：<input type="text" name="table_name" placeholder="请输入模型名称，下划线隔开" value="<?=$data['table_name'] ?>"><span style="color: red">必填</span>
                </div>
                <div>
                    service_name：<input type="text" name="service_name" placeholder="请输入服务名称，下划线隔开" value="<?=@$data['service_name'] ?>"><span style="color: red">选填</span>
                </div>
                <div>
                    SDK_function_name：<input type="text" name="function_name" placeholder="请输入方法名称：GetClubRooms" value="<?=@$data['function_name'] ?>"><span style="color: red">选填，用来定义方法名称</span>
                </div>
                <div>
                    SDK_uri：<input type="text" name="uri" placeholder="请输入接口地址的常量名称：MyActivityURI" value="<?=@$data['uri'] ?>"><span style="color: red">选填：请输入接口地址的常量名称->MyActivityURI</span>
                </div>
                <div>
                    SDK_method：
                    <select name="method">
                        <option value ="GET" <?php if($data['method'] == "GET") echo "selected='selected'"; ?>>GET</option>
                        <option value ="POST" <?php if($data['method'] == "POST") echo "selected='selected'"; ?>>POST</option>
                    </select>
                </div>
                <div>
                    <input type="submit">
                </div>
            </form>
        </div>
    </div>
<!--    dao-->

    <div class="item">
        <!--    table-->
        <?php if (!empty($data['table_name'])):?>
            <div class="item-son">
                <h2>curd_model</h2>
                <div class="text">
    <textarea name="" id="dao_mysql" cols="50" rows="30">
                    <?= $this->render('curd_model', ['data' => @$data]); ?>
                </textarea>
                </div>
            </div>

            <div class="item-son">
                <h2>dao</h2>
                <div class="text">
    <textarea name="" id="dao_mysql" cols="50" rows="30">
                    <?= $this->render('dao', ['data' => @$data]); ?>
                </textarea>
                </div>
            </div>

            <div class="item-son">
                <h2>dao_mysql</h2>
                <div class="text">
    <textarea name="" id="dao_mysql" cols="50" rows="30">
                    <?= $this->render('dao_mysql', ['data' => @$data]); ?>
                </textarea>
                </div>
            </div>
            <div class="item-son">
                <h2>dao_redis</h2>
                <div class="text">
    <textarea name="" id="dao_redis" cols="50" rows="30">
                    <?= $this->render('dao_redis', ['data' => @$data]); ?>
                </textarea>
                </div>
            </div>
        <?php endif;?>

        <!--    service-->
        <?php if (!empty($data['service_name'])):?>
            <div class="item-son">
                <h2>curd_router</h2>
                <div class="text">
<textarea name="" id="dao_mysql" cols="50" rows="30">
                <?= $this->render('curd_router', ['data' => @$data]); ?>
            </textarea>
                </div>
            </div>

            <div class="item-son">
                <h2>curd_mgr</h2>
                <div class="text">
<textarea name="" id="dao_redis" cols="50" rows="30">
                <?= $this->render('curd_mgr', ['data' => @$data]); ?>
            </textarea>
                </div>
            </div>

            <div class="item-son">
                <h2>curd_http</h2>
                <div class="text">
<textarea name="" id="dao_redis" cols="50" rows="30">
                <?= $this->render('curd_http', ['data' => @$data]); ?>
            </textarea>
                </div>
            </div>

            <div class="item-son">
                <h2>curd_service</h2>
                <div class="text">
<textarea name="" id="dao_redis" cols="50" rows="30">
                <?= $this->render('curd_service', ['data' => @$data]); ?>
            </textarea>
                </div>
            </div>
        <?php endif;?>

        <?php if (!empty($data['function_name'])):?>
            <div class="item-son">
                <h2>SDK</h2>
                <div class="text">
        <textarea name="" id="dao_redis" cols="50" rows="30">
                        <?= $this->render('sdk', ['data' => @$data]); ?>
                    </textarea>
                </div>
            </div>
        <?php endif;?>

        <div class="item-son">
            <h2>curd_code</h2>
            <div class="text">
        <textarea name="" id="dao_redis" cols="50" rows="30">
                        <?= $this->render('curd_code', ['data' => @$data]); ?>
                    </textarea>
            </div>
        </div>
    </div>




    <div class="item">

    </div>

    <div class="item">

    </div>

    <div class="item">

    </div>
</body>
<style>
    /*.item{*/
    /*    background-color: red;*/
    /*}*/
    .item-son{
        display: inline-block;
        padding-right: 100px;
    }

    input[type=text]{
        width: 300px;
    }
</style>
</html>